@extends('backstage.layout.master')
@section('title', '添加字体')
@section('style')
@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>

            <li class="active">
                <a href="backstage/fonts/list">字体列表</a>
            </li>
            <li>
                添加字体
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        添加字体
                    </h1>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form id="myform" class="form-horizontal" role="form" action="backstage/fonts/add" method="post" enctype="multipart/form-data">
                            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                            <div class="form-group product_form {{$errors->first('font_name')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right" for="font_name"> 字体名称 </label>

                                <div class="col-sm-4">
                                    <input type="text" name="font_name" value="{{old('font_name')}}" id="font_name" placeholder="字体名称"
                                           class="width-100">
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline">{{$errors->first('font_name')}} </div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('font_image')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right" for="font_image">
                                    预览图 </label>

                                <div class="col-sm-4">
                                    <input type="file" id="font_image" name="font_image" placeholder="预览图">
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline">{{$errors->first('font_image')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('font_path')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right" for="font_path">
                                    字体包 </label>

                                <div class="col-sm-4">
                                    <input type="file" id="font_path" name="font_path" placeholder="字体包">
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline">{{$errors->first('font_path')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('font_type')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right">字体类型</label>
                                <div class="col-sm-4">
                                    <select name="font_type">
                                        <option value="0" selected>英文</option>
                                        <option value="1">中文</option>
                                        <option value="2">中英文</option>
                                    </select>
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('font_type')}}</div>
                                </div>
                            </div>
                            <div class="form-group  {{$errors->first('price')!=""?'has-error':''}}">
                                <label class="col-sm-4 control-label no-padding-right" for="form-field-1">
                                    单价</label>
                                <div class="col-sm-4">
                                    <input type="number" id="price" name="price" step=0.01 min=0  placeholder="单价">
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('price')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="clearfix form-actions">
                                <div class="col-md-offset-5 col-md-7">
                                    <button class="btn btn-info" type="submit">
                                        <i class="icon-ok bigger-110"></i>
                                        保存
                                    </button>

                                    &nbsp; &nbsp; &nbsp;
                                    <button class="btn" type="reset">
                                        <i class="icon-undo bigger-110"></i>
                                        重置
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div><!-- /.col -->
                </div>
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')
    <script src="assets/js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="assets/js/jquery.slimscroll.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#font_image').ace_file_input({
                no_file: '还未选择图片',
                btn_choose: '选择',
                btn_change: '重新选择',
                droppable: false,
                onchange: null,
                thumbnail: true
            });
        });
    </script>
@stop